### append

Alias for `concat`.


```ts
function append(appendValue: string): (str: string) => string
function append(str: string, appendValue: string): string
```

### concat

Returns a new string with `appendValue` added after `str`.


```ts
function concat(appendValue: string): (str: string) => string
function concat(str: string, appendValue: string): string
```

```ts
S.concat('hello', 'world') // → 'helloworld'
pipe('ts', S.concat('belt')) // → 'tsbelt'
```

### endsWith

Returns `true` if the given string ends with `substr`.


```ts
function endsWith(substr: string): (str: string) => boolean
function endsWith(str: string, substr: string): boolean
```

```ts
S.endsWith('hello', 'o') // → true
pipe('ts-belt', S.endsWith('o')) // → false
```

### get

Returns `Some(value)`, where `value` is a string consisting of the character at location `n` in the string, or `None` if the `n` is out of range.


```ts
function get(str: string, n: number): Option<string>
function get(n: number): (str: string) => Option<string>
```

```ts
S.get('hello', 1) // → Some('e')
pipe('ts-belt', S.get(9)) // → None
```

### getUnsafe

Returns `value`, where `value` is a string consisting of the character at location `n` in the string, or `undefined` if the `n` is out of range.


```ts
function getUnsafe(str: string, n: number): string
function getUnsafe(n: number): (str: string) => string
```

```ts
S.getUnsafe('hello', 1) // → 'e'
pipe('world', S.getUnsafe(1)) // → 'o'
```

### head

Returns `Some(value)` where `value` is the first character of the string, or `None` if the given string is empty.


```ts
function head(str: string): Option<string>
```

```ts
S.head('random-text') // → Some('r')
```

### includes

Returns `true` if `searchValue` appears anywhere in the given string.


```ts
function includes(searchValue: string): (str: string) => boolean
function includes(str: string, searchValue: string): boolean
```

```ts
S.includes('hello', 'll') // → true
pipe('world', S.includes('ll')) // → false
```

### indexOf

Returns `Some(index)`, where `index` is the starting position of the first occurrence of `searchValue` within `str`.


```ts
function indexOf(searchValue: string): (str: string) => Option<number>
function indexOf(str: string, searchValue: string): Option<number>
```

```ts
S.indexOf('hello', 'e') // → Some(1)
pipe(['hello', 'world'], A.keepMap(S.indexOf('o'))) // → [4, 1]
```

### isEmpty

Returns `true` if the provided string is empty.


```ts
function isEmpty(str: string): boolean
```

```ts
S.isEmpty('hello world') // → false
S.isEmpty('') // → true
pipe('ts-belt', S.isEmpty) // → false
```

### isNotEmpty

Returns `true` if the provided string is not empty.


```ts
function isNotEmpty(str: string): boolean
```

```ts
S.isNotEmpty('hello world') // → true
S.isNotEmpty('') // → false
pipe('ts-belt', S.isNotEmpty) // → true
```

### last

Returns `Some(value)` where `value` is the last character of the string, or `None` if the given string is empty.


```ts
function last(str: string): Option<string>
```

```ts
S.last('random-text') // → Some('t')
```

### lastIndexOf

Returns `Some(index)`, where `index` is the starting position of the last occurrence of `searchValue` within `str`.


```ts
function lastIndexOf(searchValue: string): (str: string) => Option<number>
function lastIndexOf(str: string, searchValue: string): Option<number>
```

```ts
S.lastIndexOf('ts,rescript', 's') // → Some(5)
S.lastIndexOf('ts,rescript', 'x') // → None
pipe(['hello', 'ts'], A.keepMap(S.lastIndexOf('l'))) // → [3]
```

### length

Returns the length of the given string.


```ts
function length(str: string): number
```

```ts
S.length('hello') // → 5
pipe('ts-belt', S.length) // → 7
```

### make

Converts the given value to a string.


```ts
function make<A>(value: A): string
```

```ts
S.make(['hello', 'world']) // → 'hello,world'
S.make(true) // → 'true'
pipe({}, S.make) // → '[object Object]'
pipe(100, S.make) // → '100'
```

### match

Matches the given string against the provided regular expression, ir returns `None` if there is no match.


```ts
function match(str: string, regex: RegExp): Option<Array<string>>
function match(regex: RegExp): (str: string) => Option<Array<string>>
```

### prepend

Returns a new string with `prependValue` added before `str`.


```ts
function prepend(prependValue: string): (str: string) => string
function prepend(str: string, prependValue: string): string
```

```ts
S.prepend('hello', 'world') // → 'worldhello'
pipe('ts', S.prepend('belt')) // → 'beltts'
```

### remove

Returns a new string with the first occurrence of `value` removed from `str`.


```ts
function remove(value: string): (str: string) => string
function remove(str: string, value: string): string
```

```ts
S.remove('hello', 'l') // → 'helo'
pipe('ts-belt', S.remove('ts-')) // → 'belt'
```

### removeAll

Returns a new string with every occurrence of `value` removed from `str`.


```ts
function removeAll(value: string): (str: string) => string
function removeAll(str: string, value: string): string
```

```ts
S.removeAll('hello', 'l') // → 'heo'
pipe('hXellXo wXXorXXld', S.removeAll('X')) // → 'hello world'
```

### repeat

Returns a string consisting of `n` repetitions of `str`.


```ts
function repeat(str: string, n: number): string
function repeat(n: number): (str: string) => string
```

### replace

Replaces the first occurrence of `oldValue` with `newValue` in the given string and returns a new string.


```ts
function replace(oldValue: string, newValue: string): (str: string) => string
function replace(str: string, oldValue: string, newValue: string): string
```

### replaceAll

Replaces each occurrence of `oldValue` with `newValue` in the given string and returns a new string.


```ts
function replaceAll(oldValue: string, newValue: string): (str: string) => string
function replaceAll(str: string, oldValue: string, newValue: string): string
```

### replaceByRe

Replaces the matched regular expression with `newValue` in the given string and returns a new string.


```ts
function replaceByRe(str: string, regex: RegExp, value: string): string
function replaceByRe(regex: RegExp, value: string): (str: string) => string
```

### search

Returns `Some(index)`, where `index` is the starting position of the first match of regular expression in the given string.


```ts
function search(str: string, regex: RegExp): Option<number>
function search(regex: RegExp): (str: string) => Option<number>
```

### slice

Returns the substring of `str` starting at character `start` up to but not including `end`.


```ts
function slice(str: string, start: number, end: number): string
function slice(start: number, end: number): (str: string) => string
```

### sliceToEnd

Returns the substring of `str` starting at character `start` to the end of the string.


```ts
function sliceToEnd(str: string, start: number): string
function sliceToEnd(start: number): (str: string) => string
```

### split

Splits the given string at every occurrence of `delimiter` and returns an array of the resulting substrings.


```ts
function split(delimiter: string): (str: string) => Array<string>
function split(str: string, delimiter: string): Array<string>
```

### splitAt

Splits the string at the given index, returning a tuple of the parts.


```ts
function splitAt(str: string, index: number): readonly [string, string]
function splitAt(index: number): (str: string) => readonly [string, string]
```

### splitByRe

Splits the given string at every occurrence of `regex` and returns an array of the resulting substrings.


```ts
function splitByRe(str: string, regex: RegExp): Array<Option<string>>
function splitByRe(regex: RegExp): (str: string) => Array<Option<string>>
```

### startsWith

Returns `true` if the given string starts with `substr`.


```ts
function startsWith(substr: string): (str: string) => boolean
function startsWith(str: string, substr: string): boolean
```

```ts
S.startsWith('hello', 'o') // → false
pipe('ts-belt', S.startsWith('ts')) // → true
```

### toArray

Creates an array with one character of `str` per element.


```ts
function toArray(str: string): Array<string>
```

### toLowerCase

Converts `str` to lower case.


```ts
function toLowerCase(str: string): string
```

### toUpperCase

Converts `str` to upper case.


```ts
function toUpperCase(str: string): string
```

### trim

Returns a new string with leading and trailing whitespace removed from `str`.


```ts
function trim(str: string): string
```

```ts
S.trim('  text') // → 'text'
```

### trimEnd

Returns a new string with trailing whitespace removed from `str`.


```ts
function trimEnd(str: string): string
```

```ts
S.trimEnd('  text  ') // → '  text'
```

### trimStart

Returns a new string with leading whitespace removed from `str`.


```ts
function trimStart(str: string): string
```

```ts
S.trimStart('  text  ') // → 'text  '
```